package crob

import (
	"sync"
	"time"
)

var Onlines = make(chan string)
var num = 0

func Start() {
	for {
		time.Sleep(1 * time.Second)
		select {
		case <-Onlines:
			num++
		case Onlines <- "1":
			if num > 0 {
				num--
			}
		default:

		}
		//log.Println("当前在线人数为", num, "人")
	}
}
